package com.wlzg.collectiontool

import android.content.Context
import android.text.TextUtils
import androidx.multidex.MultiDexApplication
import com.blankj.utilcode.util.SPUtils
import com.haoge.easyandroid.EasyAndroid
import me.jessyan.autosize.AutoSize

class App : MultiDexApplication() {

    override fun onCreate() {
        super.onCreate()
        mContext = applicationContext
        EasyAndroid.init(mContext!!)
        AutoSize.initCompatMultiProcess(mContext)
    }

    companion object {
         var mContext: Context? = null
        private var mToken: String? = null
        fun getToken(): String? {
            if (TextUtils.isEmpty(mToken)) {
                mToken = SPUtils.getInstance().getString("TOKEN", "")
            }
            return mToken
        }

        fun setToken(token: String) {
            mToken = token
            SPUtils.getInstance().put("TOKEN", token)
        }
    }
}